
package cn.edu.scau.cmi.hombio.web.rest;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>MedicineStorageRestController</code> controller.
 *
 * @see cn.edu.scau.cmi.hombio.web.rest.MedicineStorageRestController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/pigRs-security-context.xml",
		"file:./resources/pigRs-service-context.xml",
		"file:./resources/pigRs-dao-context.xml",
		"file:./resources/pigRs-web-context.xml" })
public class MedicineStorageRestControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>MedicineStoragemedicinestorage_idemployee()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idemployee() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/employee");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idemployee()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostMedicineStoragemedicinestorage_idemployee() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/employee");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idemployee()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutMedicineStoragemedicinestorage_idemployee() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/employee");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idemployeeemployee_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteMedicineStoragemedicinestorage_idemployeeemployee_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/employee/{employee_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idemployeeemployee_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idemployeeemployee_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/employee/{employee_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idsupplier()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idsupplier() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/supplier");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idsupplier()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostMedicineStoragemedicinestorage_idsupplier() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/supplier");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idsupplier()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutMedicineStoragemedicinestorage_idsupplier() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/supplier");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idsuppliersupplier_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteMedicineStoragemedicinestorage_idsuppliersupplier_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/supplier/{supplier_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idsuppliersupplier_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idsuppliersupplier_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/supplier/{supplier_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicinePrices()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idmedicinePrices() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicinePrices");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicinePrices()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostMedicineStoragemedicinestorage_idmedicinePrices() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicinePrices");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicinePrices()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutMedicineStoragemedicinestorage_idmedicinePrices() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicinePrices");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicinePricesmedicineprice_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteMedicineStoragemedicinestorage_idmedicinePricesmedicineprice_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicinePrices/{medicineprice_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicinePricesmedicineprice_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idmedicinePricesmedicineprice_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicinePrices/{medicineprice_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicineStorageDetails()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idmedicineStorageDetails() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicineStorageDetails");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicineStorageDetails()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostMedicineStoragemedicinestorage_idmedicineStorageDetails() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicineStorageDetails");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicineStorageDetails()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutMedicineStoragemedicinestorage_idmedicineStorageDetails() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicineStorageDetails");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicineStorageDetailsmedicinestoragedetail_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteMedicineStoragemedicinestorage_idmedicineStorageDetailsmedicinestoragedetail_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicineStorageDetails/{medicinestoragedetail_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_idmedicineStorageDetailsmedicinestoragedetail_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_idmedicineStorageDetailsmedicinestoragedetail_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}/medicineStorageDetails/{medicinestoragedetail_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStorage()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStorage() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetMedicineStoragemedicinestorage_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStorage()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutMedicineStorage() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStorage()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostMedicineStorage() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>MedicineStoragemedicinestorage_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteMedicineStoragemedicinestorage_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/MedicineStorage/{medicinestorage_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		MedicineStorageRestController controller = (MedicineStorageRestController) context.getBean("MedicineStorageRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}